import os
# 修复SSL权限错误 - 禁用SSL密钥日志
os.environ['SSLKEYLOGFILE'] = ''
from openai import OpenAI


client = OpenAI(
    api_key="sk-f648b6ff7a0b40999edc8c15ec81c459",
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
)

completion = client.chat.completions.create(
    model="qwen3-max",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "你是谁？"},
    ],
    stream=True
)
print(completion.model_dump_json())